/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Clases;

import java.util.LinkedList;
import java.util.List;
import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;

/**
 *
 * @author TVD
 */
public class ModeloResponsables implements ComboBoxModel {
private List<Responsable> mResponsables;
private ListDataListener l ;
private Responsable seleccionado;
    public ModeloResponsables(LinkedList <Responsable> l) {
        mResponsables = l;
    }

    @Override
    public void setSelectedItem(Object anItem) {
        seleccionado =(Responsable) anItem;
    }

    @Override
    public Object getSelectedItem() {
      return seleccionado;
    }

    @Override
    public int getSize() {
        return mResponsables.size();
    }

    @Override
    public Object getElementAt(int index) {
        return mResponsables.get(index);
    }

    @Override
    public void addListDataListener(ListDataListener l) {
       this.l = l;
    }

    @Override
    public void removeListDataListener(ListDataListener l) {
        this.l = l;
    }
     public void removeFirst()
    {
        mResponsables.remove(0);
    
    }
}
